package pe.com.hermes.hermetic.web.controller.configuracion;

import pe.com.hermes.hermetic.negocio.service.HermeticFacade;

import pe.com.hermes.hermetic.web.controller.base.IController;

import pe.com.hermes.hermetic.web.forms.ConfCategForm;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.SessionAttributes;

@Controller
@RequestMapping("/configurar_categorias.html")
@SessionAttributes("form")
public class ConfigurarCategoriasParamController implements IController{
    protected final static Logger logger = Logger.getLogger(ConfigurarCategoriasParamController.class);
    @Autowired
    private HermeticFacade servicioHermetic;
    protected String showForm(ModelMap model,HttpServletRequest request)throws Exception{
        logger.info(this.getClass().toString()+" "+"metodo: GET");
        String cliente = (String)request.getSession(false).getAttribute("cliente");
        String sucursal = (String)request.getSession(false).getAttribute("sucursal");
        ConfCategForm form = new ConfCategForm();
        form.setListCategorias(servicioHermetic.getListGrupTipoGenerico("721"));
        form.setListCategoriasDetalle(servicioHermetic.getListGrupTipoGenerico("719"));
        model.put(FORM_KEY,form);
        return null;
    }
}
